<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	request.setAttribute("basePath", basePath);
%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>调整公司员工职位</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<%--<link rel="shortcut icon" href="${basePath}/statics/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="${basePath}/statics/css/font.css">
		<link rel="stylesheet" href="${basePath}/statics/css/xadmin.css">--%>
		<script src="${basePath}/statics/js/jquery.min.js"></script>
		<script type="text/javascript" src="${basePath}/statics/lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="${basePath}/statics/js/xadmin.js"></script>
		<script>
			function dept(){
				var did=$("#select1").val();
				$.post("../sectionajax.action",{deptId:did},function (data){
					var nameOpt = "<option value='' selected='selected'>--请选择--</option>";
					for (var i=0;i<data.length;i++){
						nameOpt+="<option value='"+data[i].id+"' >"+data[i].name+"</option>"
					}
					$('#select2').html(nameOpt);
				})
			}

			function select(){
				var sid=$("#select2").val();
				$.post("../postajax.action",{sectionId:sid},function (data){
					var nameOpt = "<option value='' selected='selected'>--请选择--</option>";
					for (var i=0;i<data.length;i++){
						nameOpt+="<option value='"+data[i].id+"' >"+data[i].name+"</option>"
					}
					$('#select3').html(nameOpt);
				})
			}


		</script>

		<style>
			*{
				margin: 0;
			}
			table {
				border-collapse: collapse;
				border:0;
			}
			td{
				width: 70px;
				height: 30px;
				border:0;
			}
			.c1{
				width: 150px;
				padding: 5px;
				float: left;
				margin-top: 1px;
			}
			input{
				float: left;
				width: 450px;
				height: 34px;
				padding: 0;
			}
			.select{
				width: 454px;
				height: 37px;
			}
			button{
				width: 70px;
				height: 40px;
				background-color: cornflowerblue;
				border: 0;
			}
		</style>
	</head>

	<body>
	<div align="center">
		<br /><br />
		<h1>修改公司员工职位</h1>
		<br /><br />
		<form action="${basePath}/worker/editor/editworker.action" method="post">
			<input type="hidden" name="userAndCompanyId" value="${userAndCompanyVO.userAndCompanyId}">
			<input type="hidden" name="companyId" value="${userAndCompanyVO.companyId}">
			<table border="1px" width="600px">
				<tr style="text-align: center;">
					<td bgcolor="#D0E1FB" class="c1">员工姓名</td>
					<td><input type="text"  autocomplete="off" value="${userAndCompanyVO.userName}" readonly="readonly"></td>
				</tr>
				<!--分配部门-->
				<tr style="text-align: center;">
					<td bgcolor="#D0E1FB" class="c1">分配部门</td>
					<td>
						<select class="select" id="select1" name="deptId" onchange="dept()">
							<c:forEach items="${listDept}" var="dept">
								<option value="${dept.deptId}" >${dept.deptName}</option>

							</c:forEach>
						</select>
					</td>
				</tr>
				<!--分配科室-->
				<tr style="text-align: center;">
					<td bgcolor="#D0E1FB" class="c1">分配科室</td>
					<td>
						<select class="select" id="select2" name="sectionId" onchange="select()">
							<option value="${userAndCompanyVO.sectionId}">${userAndCompanyVO.sectionName}</option>
						</select>
					</td>
				</tr>
				<!--分配职位-->
				<tr style="text-align: center;">
					<td bgcolor="#D0E1FB" class="c1">分配职位</td>
					<td>
						<select class="select" id="select3" name="postId">
							<option class="c1" value="${userAndCompanyVO.postId}">${userAndCompanyVO.postId}</option>
						</select>
					</td>
				</tr>

				<tr style="text-align: center;">
					<td bgcolor="#D0E1FB" class="c1">员工基本薪资</td>
					<td><input type="text" name="salary" autocomplete="off" value="${userAndCompanyVO.salary}"  placeholder="${userAndCompanyVO.salary}"></td>
				</tr>

				<tr style="text-align: center;">
					<td bgcolor="#D0E1FB" class="c1">员工在职状态</td>
					<td><input type="text" name="empStateName" autocomplete="off" value="${userAndCompanyVO.empStateName}" placeholder="${userAndCompanyVO.empStateName}"></td>
				</tr>


			</table>
			<br /><br /><br />
			<div>
				<div>
					<div>
						<button type="submit">修改</button>
						<button type="reset">重置</button>
					</div>
				</div>
			</div>
		</form>
	</div>

				<%--<div >添加公司员工</div>

					<form  action="${basePath}/worker/editor/editworker.action" >

							<label >员工姓名</label>
							<div >
								<input type="text" name="userTel" autocomplete="off" value="${userAndCompanyVO.userName}" readonly="readonly" >
							</div>
						</div>

						<div >
							&lt;%&ndash;<label class="layui-form-label">分配部门</label>&ndash;%&gt;
							<div >
								<div>
									<select id="select1" name="deptId" onchange="dept()" >
										<option value="">分配部门</option>
										<c:forEach items="${listDept}" var="dept">
											<option value="${dept.deptId}" >${dept.deptName}</option>

										</c:forEach>
									</select>
								</div>
								&lt;%&ndash;<label class="layui-form-label">分配科室</label>&ndash;%&gt;
								<div >
									<select id="select2" name="sectionId" onchange="select()">
										<option value="">分配科室</option>

									</select>

								</div>
								&lt;%&ndash;<label class="layui-form-label">分配职位</label>&ndash;%&gt;

								<div >
									<select id="select3" name="postId">
										<option value="">分配职位</option>
										<option value="西湖区">西湖区</option>
										<option value="余杭区">余杭区</option>
										<option value="拱墅区">临安市</option>
									</select>

								</div>
								<label >员工基本薪资</label>
								<div >
									<input type="text" name="salary" autocomplete="off" placeholder="员工电话号码" >
								</div>
							</div>
						</div>

						<div >
							<div >
								<div >
									<button  type="submit">立即提交</button>
									<button type="reset" >重置</button>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>--%>



		<style id="LAY_layadmin_theme">
			.layui-side-menu,
			.layadmin-pagetabs .layui-tab-title li:after,
			.layadmin-pagetabs .layui-tab-title li.layui-this:after,
			.layui-layer-admin .layui-layer-title,
			.layadmin-side-shrink .layui-side-menu .layui-nav>.layui-nav-item>.layui-nav-child {
				background-color: #20222a !important;
			}
			
			.layui-nav-tree .layui-this,
			.layui-nav-tree .layui-this>a,
			.layui-nav-tree .layui-nav-child dd.layui-this,
			.layui-nav-tree .layui-nav-child dd.layui-this a {
				background-color: #009688 !important;
			}
			
			.layui-layout-admin .layui-logo {
				background-color: #20222A !important;
			}
		</style>
	</body>

</html>